Fix push/pop usage in tools/ioemu for x86/64.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 10 Apr 2006 16:25:42 +0000 (17:25 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 10 Apr 2006 16:25:42 +0000 (17:25 +0100)
Signed-off-by: Keir Fraser <keir@xensource.com>
tools/ioemu/hw/vga.c

index 11daaa27a23e8d20d8cf15ce8f2ca569c664bca8..c6fca32ae4d1f670ad4427003cab146791660def 100644 (file)
@@ -1369,10 +1369,16 @@ static inline unsigned int cpuid_edx(unsigned int op)
 {
     unsigned int eax, edx;
 
-    __asm__("pushl %%ebx; cpuid; popl %%ebx"
+#ifdef __x86_64__
+#define __bx "rbx"
+#else
+#define __bx "ebx"
+#endif
+    __asm__("push %%"__bx"; cpuid; pop %%"__bx
             : "=a" (eax), "=d" (edx)
             : "0" (op)
             : "cx");
+#undef __ebx
 
     return edx;
 }